package model

import (
	"time"
)

/*
DB Table Details
-------------------------------------


Table: mch
[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: false  col: INT8            len: -1      default: []
[ 1] mch_id                                         VARCHAR(32)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 32      default: []
[ 2] api_cert                                       TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
[ 3] api_secret                                     VARCHAR(80)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 80      default: []
[ 4] serial_no                                      VARCHAR(80)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 80      default: []
[ 5] create_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
[ 6] update_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []


JSON Sample
-------------------------------------
{    "mch_id": "tCdWCOyBGtJdtShOBBEDdRUVF",    "api_cert": "DmakCHZLwvILhRYCqjdWeEIAg",    "api_secret": "puxEadkBfcMrqgkryVkhIOZtu",    "serial_no": "NBUXTigQAbiHdPaEjseyUYeSl",    "create_time": "2238-04-24T06:20:44.403115444+08:00",    "update_time": "2088-12-05T01:07:21.15900873+08:00",    "id": 78}



*/

// Mch struct is a row record of the mch table in the wxpay database
type Mch struct {
	//[ 0] id                                             INT8                 null: false  primary: true   isArray: false  auto: false  col: INT8            len: -1      default: []
	ID int64 `gorm:"primary_key;column:id;type:INT8;"`
	//[ 1] mch_id                                         VARCHAR(32)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 32      default: []
	MchID string `gorm:"column:mch_id;type:VARCHAR;size:32;"`
	//[ 2] api_cert                                       TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	APICert string `gorm:"column:api_cert;type:TEXT;"`
	//[ 3] api_secret                                     VARCHAR(80)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 80      default: []
	APISecret string `gorm:"column:api_secret;type:VARCHAR;size:80;"`
	//[ 4] serial_no                                      VARCHAR(80)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 80      default: []
	SerialNo string `gorm:"column:serial_no;type:VARCHAR;size:80;"`
	//[ 5] create_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
	CreateTime time.Time `gorm:"column:create_time;type:TIMESTAMPTZ;"`
	//[ 6] update_time                                    TIMESTAMPTZ          null: false  primary: false  isArray: false  auto: false  col: TIMESTAMPTZ     len: -1      default: []
	UpdateTime time.Time `gorm:"column:update_time;type:TIMESTAMPTZ;"`
}

// TableName sets the insert table name for this struct type
func (m *Mch) TableName() string {
	return "mch"
}
